<template>
	<view class="tabbar-index">
		<view class="index_name">
			<view>福建农林大学金山校区</view>
			<button class="cu-btn round lines" @tap="chooseSchool">切换校区</button>
		</view>
		<view class="index_banner">
			<image src="../../static/images/banner_01.png" mode="aspectFill"></image>
		</view>
		<view class="index_tab">
			<view class="tab_item" :class="{active: type == 0}" @tap="changeType" :data-type="0">全部</view>
			<view class="tab_item" :class="{active: type == 1}" @tap="changeType" :data-type="1">待授权</view>
			<view class="tab_item" :class="{active: type == 2}" @tap="changeType" :data-type="2">待授权</view>
			<view class="tab_item" :class="{active: type == 3}" @tap="changeType" :data-type="3">已完成</view>
		</view>
		<view class="index_list">
			<view class="index_item" v-for="item in 10">
				<view class="item_01">
					<view>张晓琴</view>
					<text>2021-02-03</text>
					<view class="item_01_right">已授权</view>
				</view>
				<view class="item_02">
					<text>到访事由：</text>
					<view>拜访朋友</view>
				</view>
				<view class="item_02">
					<text>到访时间：</text>
					<view>拜访朋友</view>
				</view>
				<view class="item_02">
					<text>截止时间：</text>
					<view>拜访朋友</view>
				</view>
				<view class="item_02">
					<text>入校地址：</text>
					<view>拜访朋友</view>
				</view>
				<view class="item_btns">
					<!-- <button class="cu-btn round lianxi">联系方式</button> -->
					<button class="cu-btn round tongxing">通行证</button>
					<button class="cu-btn round chexiao">撤销</button>
					<button class="cu-btn round">查看详情</button>
				</view>
			</view>
		</view>
		<view class="bottom_tips">{{loading?'加载中...':'我是有底线的'}}</view>
	</view>
</template>

<script>
	export default {
		name:"TabbarIndex",
		props:{
			loading:{
				type:Boolean,
				default:false
			}
		},
		data() {
			return {
				type: 0,
			};
		},
		methods:{
			chooseSchool(){
				uni.navigateTo({
					url: '/pages/chooseSchool/chooseSchool'
				})
			},
			changeType(e){
				const { type } = e.currentTarget.dataset
				this.type = type
			}
		}
	}
</script>

<style scoped>
.tabbar-index{
	padding-bottom: 70px;
}
.index_name{
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20upx 32upx;
	color: #343434;
	font-size: 32upx;
}
.index_name button{
	color: #1BC46A;
	border-color: #1BC46A;
}
.index_banner{
	padding: 12upx 32upx;
}
.index_banner image{
	display: block;
	width: 100%;
	height: 286upx;
}
.index_tab{
	margin-top: 48upx;
	display: flex;
	padding: 0 32upx;
	position: sticky;
	position: -webkit-sticky;
	top: 0;
	/* #ifdef H5 */
	top: 44px;
	/* #endif */
	background-color: #FFFFFF;
	z-index: 99;
}
.tab_item{
	width: 120upx;
	height: 80upx;
	text-align: center;
	line-height: 80upx;
	font-size: 28upx;
	position: relative;
}
.tab_item::after{
	content: " ";
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: 55upx;
	height: 4upx;
	opacity: 0;
	background: #1bc46a;
	border-radius: 12px;
}
.tab_item.active{
	font-size: 40upx;
	color: #1BC46A;
}
.tab_item.active::after{
	opacity: 1;
}
.index_list{
	padding: 0 32upx;
}
.index_item{
	margin-top: 24upx;
	background-color: #FFF;
	border-radius: 20upx;
	padding: 32upx 0 0 24upx;
}
.item_01{
	display: flex;
	align-items: center;
	position: relative;
	font-weight: 500;
	font-size: 36upx;
	color: #2c322f;
	margin-bottom: 24upx;
}
.item_01 text{
	font-weight: 400;
	color: #999e9c;
	font-size: 28upx;
	display: block;
	margin-left: 32upx;
}
.item_01 .item_01_right{
	height: 52upx;
	line-height: 52upx;
	padding: 0 18upx;
	background: #1bc46a;
	font-size: 28upx;
	text-shadow: 0px 5px 16px -4px rgba(190,231,253,0.37); 
	color: #ffffff;
	border-radius: 30px 0px 0px 30px;
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
}
.item_02{
	margin-top: 16upx;
	display: flex;
	color: #343434;
	font-size: 28upx;
}
.item_02 text{
	color: #999E9C;
}
.item_btns{
	border-top: 1upx solid #ebebeb;
	margin: 52upx 0 0 -32upx;
	padding: 24upx 32upx;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.item_btns button{
	width: 180upx;
	height: 60upx;
	line-height: 60upx;
	font-size: 28upx;
	background-color: #e4f2fe;
	color: #2893ff;
}
.item_btns .lianxi{
	background-color: #fff9ec;
	color: #ffaf16;
}
.item_btns .tongxing{
	background: #e4feef;
	color: #1bc46a;
}
.item_btns .chexiao{
	background: #fff1f0;
	color: #ff6c3a;
}
.bottom_tips{
	padding: 36upx 0;
	text-align: center;
	font-size: 24upx;
	color: #bcbebf;
}
</style>
